package team.pwy.service;

import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import team.pwy.consts.RbmConsts;
import team.pwy.mapper.PhoneMapper;

@Component
public class PhoneServerImpl implements PhoneService{

    @Resource
    private PhoneMapper phoneMapper;

    @RabbitHandler
    @RabbitListener(queues = RbmConsts.PHO_QUEUE)
    public void addPhone(String phone) {
        phoneMapper.addPhone(phone);
    }
}
